Friend Class gridCell
    Private m_value As Double
    Private m_controlValue As Double
    Private m_controlSwitch As Double
    Private m_toBeSet As Boolean = False
    Private m_update As Boolean = False

    Sub New(ByVal value As Integer, ByVal controlValue As Double, ByVal controlSwitch As Double)
        m_value = value
        m_controlValue = controlValue
        m_controlSwitch = controlSwitch
    End Sub
    Sub New(ByVal value As Double)
        m_value = value
    End Sub

    Public Property toBeSet() As Boolean
        Get
            Return m_toBeSet
        End Get
        Set(ByVal value As Boolean)
            m_toBeSet = value
        End Set
    End Property
    Public Property Update() As Boolean
        Get
            Return m_update
        End Get
        Set(ByVal value As Boolean)
            m_update = value
        End Set
    End Property
    Public Property controlBit() As Boolean
        Get
            If m_value >= m_controlValue Then
                Return True
            Else
                Return False
            End If
        End Get
        Set(ByVal value As Boolean)
            If value Then If Not controlBit Then m_value += m_controlSwitch
            If Not value Then If controlBit Then m_value -= m_controlSwitch
        End Set
    End Property
    Public Property value() As Double
        Get
            Return m_value
        End Get
        Set(ByVal value As Double)
            m_value = value
        End Set
    End Property
    Public Property controlValue() As Double
        Get
            Return m_controlValue
        End Get
        Set(ByVal value As Double)
            m_controlValue = value
        End Set
    End Property
    Public Property controlSwitch() As Double
        Get
            Return m_controlSwitch
        End Get
        Set(ByVal value As Double)
            m_controlSwitch = value
        End Set
    End Property
End Class
